<%--
 *  File:    OrgInfo.jsp
 *  @Author: Langerwang ,KentZhong
 *  Date:    2001/12/10
 *  @Modifier: Jamesli
 *  Date:    2010/06/28
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.OrgInfo");  
  String strPrivCode=(String)request.getParameter("third");  
  if( strPrivCode==null)
    strPrivCode=(String)session.getAttribute("third");
  if(strPrivCode==null)
    strPrivCode="";
  String privilegeCode = strPrivCode;
  String strModuleName = "OGM";
%>
  
<%!
        private static Object getFromVector(Vector vec, String columnname, String key) {
        Object ret = null;
        if (vec != null) {
            for (int i = 0; i < vec.size(); i++) {
                HashMap hash = (HashMap) vec.elementAt(i);
                if (hash == null) break;
                if (columnname.equals(hash.get("mdcolumnname"))) {
                    ret = hash.get(key);
                }
            }
        }
        return ret;
    }
%>
  
<%
  String dateFormat = (String)session.getAttribute("dateformat");
  	if(dateFormat==null)
  		dateFormat = "yyyy-MM-dd";
  //get location
%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<html>
<head>
<PageFlow:CheckPageFlow pageName="orginfo"/>
<%
  HashMap orgInfo = (HashMap)pageContext.getAttribute("orginfo");
  if(orgInfo == null)
    orgInfo = new HashMap();
 
  cat.debug("The orgInfo is :" + orgInfo);
%>
<%
              Vector    vecMdConfig = (Vector) pageContext.getAttribute("mdconfig");
              HashMap curOrgHash =  (HashMap)pageContext.getAttribute("orginfo");
              if (curOrgHash == null){
                curOrgHash = new HashMap();
              }
              Integer entity = (Integer) curOrgHash.get("orgid");
              if (entity == null)      entity=new Integer(-1);

                  HashMap hashSalesChannel=new HashMap();
                   hashSalesChannel.put("languagecode",session.getAttribute("languagecode"));
                   //hashSalesChannel.put("orgid",((HashMap)pageContext.getAttribute("orginfo")).get("orgid"));
                   hashSalesChannel.put("entityid",entity);
                   Integer  intSalesChannel=(Integer)getFromVector(vecMdConfig,"saleschannelid","mdconfigid");
                  // \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\u03aa\ufffd\ufffdRetailFormat\ufffd\ufffd\ufffd\ufffdurl\ufffd\u00f5\u0121\ufffd
                  String   strSalesChannelQlName = (String)getFromVector(vecMdConfig,"saleschannelid","qlname");
                  if(strSalesChannelQlName==null)    strSalesChannelQlName = "default" ;
                  Integer  intSalesChannelValueSource=(Integer)getFromVector(vecMdConfig,"saleschannelid","valuesource");
                  String  strSalesChannelColName=(String)getFromVector(vecMdConfig,"saleschannelid","mdcolumnname");
                  String  strSalesChannelDateManageFlag=(String)getFromVector(vecMdConfig,"saleschannelid","datemanageflag");

                 HashMap hashRegion = new HashMap();
                  hashRegion.put("languagecode",session.getAttribute("languagecode"));
                  hashRegion.put("entityid",entity);
                  Integer  intRegion=(Integer)getFromVector(vecMdConfig,"regioncode","mdconfigid");
                  String  strRegionQlName=(String)getFromVector(vecMdConfig,"regioncode","qlname");
                  if(strRegionQlName==null)    strRegionQlName = "default" ;
                  Integer  intRegionValueSource=(Integer)getFromVector(vecMdConfig,"regioncode","valuesource");
                  String  strRegionColName=(String)getFromVector(vecMdConfig,"regioncode","mdcolumnname");
                   String  strRegionDateManageFlag=(String)getFromVector(vecMdConfig,"regioncode","datemanageflag");

                  HashMap hashCity = new HashMap();
                  hashCity.put("languagecode",session.getAttribute("languagecode"));
                  hashCity.put("entityid",entity);
                  Integer  intCity=(Integer)getFromVector(vecMdConfig,"citycode","mdconfigid");
                  String  strCityQlName=(String)getFromVector(vecMdConfig,"citycode","qlname");
                  if(strCityQlName==null)    strCityQlName = "default" ;
                  Integer  intCityValueSource=(Integer)getFromVector(vecMdConfig,"citycode","valuesource");
                  String  strCityColName=(String)getFromVector(vecMdConfig,"citycode","mdcolumnname");
                 String  strCityDateManageFlag=(String)getFromVector(vecMdConfig,"citycode","datemanageflag");

                 HashMap hash=new HashMap();
                 hash.put(intSalesChannel,hashSalesChannel) ;
                 hash.put(intRegion,hashRegion) ;
                 hash.put(intCity,hashCity) ;
                 session.setAttribute("criteria",hash);


   %>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td class="summary_top"></td>
  </tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0" >
<form name="form1" method="post" action="">
  <tr> 
    <td valign="top"> 
        <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="3">
          <tr> 
            <td colspan="5" class="deepblue-left" height="22"> <img src="../../images/<%= strLanguageCode %>/quote.gif"> 
              <%= label.getLabelName("L_BasicInfo") + label.getLabelName("L_Colon") %> </td>
          </tr>
          <tr>
            <td width="106" class="td-text"><%= label.getLabelName("L_OrganizationCode") + label.getLabelName("L_Colon") %></td>
            <td>&nbsp;<%=JspHelper.filterNull( orgInfo.get("orgcode") )%></td>
            <td width="106" class="td-text"><%= label.getLabelName("L_RefCode") + label.getLabelName("L_Colon") %></td>
            <td><%=JspHelper.filterNull( orgInfo.get("referenceorgcode") )%></td>
          </tr>
          
          <tr> 
            <td width="106" class="td-text"><%= label.getLabelName("L_ERPCode") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%=JspHelper.filterNull( orgInfo.get("zyl_erpcode") )%></td>
            <td class="td-text" width="122" ><%= label.getLabelName("L_ParentOrgShortName") + label.getLabelName("L_Colon") %></td>
            <td>&nbsp;<%=JspHelper.filterNull( orgInfo.get("parentorgcode") )%></td>
          </tr>
          
          <tr> 
            <td class="td-text" width="106"><%= label.getLabelName("L_OrgName") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%=JspHelper.filterNull( orgInfo.get("orgname") )%></td>
            <td class="td-text" ><%= label.getLabelName("L_OrgShortName") + label.getLabelName("L_Colon") %></td>
            <td>
            	<custom:write property="shortname" name="orginfo" nbsp="true"/>
            </td>
          </tr>
          
          <tr> 
            <td width="106" class="td-text"><%= label.getLabelName("L_GlobalPCName") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%=JspHelper.filterNull( orgInfo.get("pccodename") )%></td>
            <td class="td-text" width="122" ><%= label.getLabelName("L_OrgGrade") + label.getLabelName("L_Colon") %></td>
            <td>&nbsp;<%=JspHelper.filterNull( orgInfo.get("dtlevel1name") )%></td>
          </tr>
          
          <tr> 
            <td width="106" class="td-text"><%= label.getLabelName("L_DealersLevel") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%=JspHelper.filterNull( orgInfo.get("dtlevelname") )%></td>
            <td class="td-text" width="122" ><%= label.getLabelName("L_PuYaoBusinessLevel") + label.getLabelName("L_Colon") %></td>
            <td>&nbsp;<%=JspHelper.filterNull( orgInfo.get("druglevel") )%></td>
          </tr>
          
          <tr> 
            <td width="106" class="td-text"><%= label.getLabelName("L_CountryName") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%=JspHelper.filterNull( orgInfo.get("countryname") )%></td>
            <td class="td-text" width="122" ><%= label.getLabelName("L_Province") + label.getLabelName("L_Colon") %></td>
            <td>&nbsp;<%=JspHelper.filterNull( orgInfo.get("regionname") )%></td>
          </tr>
          
           <tr> 
            <td width="106" class="td-text"><%= label.getLabelName("L_CityName") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%=JspHelper.filterNull( orgInfo.get("cityname") )%></td>
            <td class="td-text" width="122" ><%= label.getLabelName("L_County") + label.getLabelName("L_Colon") %></td>
            <td>&nbsp;<%=JspHelper.filterNull( orgInfo.get("countyname") )%></td>
          </tr>
          
          <tr> 
            <td width="106" class="td-text"><%= label.getLabelName("L_URL") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%=JspHelper.filterNull( orgInfo.get("url") )%></td>
            <td class="td-text" width="122" ><%= label.getLabelName("L_Email") + label.getLabelName("L_Colon") %></td>
            <td>&nbsp;<%=JspHelper.filterNull( orgInfo.get("email") )%></td>
          </tr>
          
           <tr> 
            <td width="106" class="td-text"><%= label.getLabelName("L_Telephone") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%=JspHelper.filterNull( orgInfo.get("telephone") )%></td>
            <td class="td-text" width="122" ><%= label.getLabelName("L_Fax") + label.getLabelName("L_Colon") %></td>
            <td>&nbsp;<%=JspHelper.filterNull( orgInfo.get("fax") )%></td>
          </tr>
          
          <tr> 
            <td width="106" class="td-text"><%= label.getLabelName("L_ZipCode") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%=JspHelper.filterNull( orgInfo.get("zipcode") )%></td>
            <td class="td-text" width="122" ><%= label.getLabelName("L_StatusName") + label.getLabelName("L_Colon") %></td>
            <td>&nbsp;<%=JspHelper.filterNull( orgInfo.get("statusname") )%></td>
          </tr>
          
         <!--  <tr>
          	<td class="td-text" width="122"><%= label.getLabelName("L_StatusName") + label.getLabelName("L_Colon") %></td>
            <td>&nbsp;<%=JspHelper.filterNull( orgInfo.get("statusname") )%></td>
          	<td class="td-text"><%= label.getLabelName("L_URL") + label.getLabelName("L_Colon") %></td>
            <td><custom:write name="orginfo" property="url" nbsp="true"/></td>
          </tr>
          <tr> 
            <td class="td-text"><%= label.getLabelName("L_Telephone") + label.getLabelName("L_Colon") %></td>
            <td>
               <custom:write name="orginfo" property="telephone" nbsp="true"/>
            </td>
            <td class="td-text"><%= label.getLabelName("L_Fax") + label.getLabelName("L_Colon") %></td>
            <td> 
               <custom:write name="orginfo" property="fax" nbsp="true"/>
            </td>
          </tr>
          <tr> 
            <td class="td-text"><%= label.getLabelName("L_Email") + label.getLabelName("L_Colon") %></td>
            <td > 
               <custom:write name="orginfo" property="email" nbsp="true"/>
            </td>
            <td class="td-text"><%= label.getLabelName("L_ZipCode") + label.getLabelName("L_Colon") %></td>
            <td > 
               <custom:write name="orginfo" property="zipcode" nbsp="true"/>
            </td>
          </tr>-->
          
          
          <tr> 
            <td class="td-text"><%= label.getLabelName("L_Address") + label.getLabelName("L_Colon") %></td>
            <td colspan="3">
               <custom:write name="orginfo" property="address" nbsp="true"/>
            </td>
          </tr>
          <tr> 
            <td class="td-text"><%= label.getLabelName("L_Comments") + label.getLabelName("L_Colon") %></td>
            <td colspan="3"> 
               <custom:write name="orginfo" property="comments" nbsp="true"/>
            </td>
          </tr>
          
          <tr> 
            <td class="deepblue-left" colspan="5"><img src="../../images/<%= strLanguageCode %>/quote.gif"> 
              <%= label.getLabelName("L_OrgRegistrationInfo") + label.getLabelName("L_Colon") %></td>
          </tr>
          <tr> 
            <td class="td-text" width="106"><%= label.getLabelName("L_OrgOpenDate") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%= OvalTools.dateToString(orgInfo.get("opendate"), dateFormat) %></td>
            <td class="td-text" width="122"><%= label.getLabelName("L_CorporatePerson") + label.getLabelName("L_Colon") %></td>
            <td width="228" colspan="2" >&nbsp;<%=JspHelper.filterNull( orgInfo.get("corporateperson") )%></td>
          </tr>
          
          <tr> 
            <td class="td-text" width="106"><%= label.getLabelName("L_CorporationTypeName") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%=JspHelper.filterNull( orgInfo.get("corptypename") )%></td>
            <td class="td-text" width="122"><%= label.getLabelName("L_RegisterFund") + label.getLabelName("L_Colon") %></td>
            <td width="228" colspan="2" >&nbsp;<oval:write name="orginfo" property="registerfund" isView="true" schemaName="ovorg"/></td>
          </tr>
          
          
          <!-- <tr> 
            <td class="td-text" width="106"><%= label.getLabelName("L_WorkingScope") + label.getLabelName("L_Colon") %></td>
            <td colspan="4" >&nbsp;<%=JspHelper.filterNull( orgInfo.get("workingscope") )%></td>
          </tr>
          -->
          
           <tr> 
            <td class="td-text" width="106"><%= label.getLabelName("L_LicenseNumber") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%=JspHelper.filterNull( orgInfo.get("lisenceno") )%></td>
            <td class="td-text" width="122"><%= label.getLabelName("L_BankName") + label.getLabelName("L_Colon") %></td>
            <td width="228" colspan="2" >&nbsp;<oval:write name="orginfo" property="accountbank" isView="true" schemaName="ovorg"/></td>
          </tr>
          
          <tr> 
            <td class="td-text" width="106"><%= label.getLabelName("L_BankAccount") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%=JspHelper.filterNull( orgInfo.get("accountno") )%></td>
            <td class="td-text" width="122"><%= label.getLabelName("L_VATRegistrationNumber") + label.getLabelName("L_Colon") %></td>
            <td width="228" colspan="2" >&nbsp;<oval:write name="orginfo" property="taxno" isView="true" schemaName="ovorg"/></td>
          </tr>
          <tr>
           	<td class="td-text"><%= label.getLabelName("L_RegisteredAddress") + label.getLabelName("L_Colon") %></td>
            <td colspan="3">
               <oval:write name="orginfo" property="registeraddress" isView="true" schemaName="ovorg"/>
            </td>
          <!--
          <tr>
		  <td class="deepblue-left"colspan="4" height="22"><img src="../../images/<%= strLanguageCode %>/quote.gif"> 
              <%= label.getLabelName("L_OtherInfo") + label.getLabelName("L_Colon") %></td>
          </tr>
           <tr> 
            <td class="td-text"><%= label.getLabelName("L_Province") + label.getLabelName("L_Colon") %></td>
            <td>&nbsp;<%=JspHelper.filterNull( orgInfo.get("regionname") )%>
              <%if( "1".equals(strRegionDateManageFlag)){%>
                         <a onclick="window.open('DateManageForRegionCity.jsp?<%= OvalTools.randomURL() %>&mdconfigid=<%=JspHelper.filterNull(intRegion)%>&qlname=<%=JspHelper.filterNull(strRegionQlName)%>&valuesource=<%=JspHelper.filterNull(intRegionValueSource)%>&colname=<%=JspHelper.filterNull(strRegionColName)%>&entityid=<custom:write name="orginfo"  property="orgid"/>&displayflag=view', 'newwindow', 'height=300, width=600,top=100,left=100,toolbar=n0, menubar=no, scrollbars=yes, resizable=no, location=no, status=no')"><input type=button class="button3" value="*"></a>
            <%}%>
            </td>
            <td class="td-text"><%= label.getLabelName("L_CityName") + label.getLabelName("L_Colon") %></td>
            <td >&nbsp;<%=JspHelper.filterNull( orgInfo.get("cityname") )%>
            <%if( "1".equals(strCityDateManageFlag)){%>
                        <a onclick="window.open('DateManageForRegionCity.jsp?<%= OvalTools.randomURL() %>&mdconfigid=<%=JspHelper.filterNull(intCity)%>&qlname=<%=JspHelper.filterNull(strCityQlName)%>&valuesource=<%=JspHelper.filterNull(intCityValueSource)%>&colname=<%=JspHelper.filterNull(strCityColName)%>&entityid=<custom:write name="orginfo"  property="orgid"/>&displayflag=view', 'newwindow', 'height=300, width=600,top=100,left=100,toolbar=n0, menubar=no, scrollbars=yes, resizable=no, location=no, status=no')"><input type=button class="button3" value="*"></a>
            <%}%>
            </td>
          </tr>
          <tr> 
            <td class="td-text"><%= label.getLabelName("L_County") + label.getLabelName("L_Colon") %></td>
            <td>
              	<custom:write property="countyname" name="orginfo" nbsp="true"/>
            </td>
            <td class="td-text">&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
           -->
          </table>
      </td>
  </tr>
  <tr>
    <td class="summary_top"></td>
  </tr>
  <tr> 
      <td height="49" class="td_center"> <a onclick="history.back(-1);"><custom:button type="1" label="L_Back" imgsrc="back.gif" border="0" style="width:60"/></a>
    </td>
  </tr>
      </form>
</table>
</body>
</html>



